library(tidyverse)
library(tidymodels)
library(lubridate)
library(magrittr)
library(plotly) # interactive ggplot
library(here) # dir
library(parallel) # multi-processing
library(knitr)
here()
## [1] "C:/Users/rhyeu/Documents/GitHub/kaggle-study"
Walmart in Tidymodels
Walmart mothership Data
train <- read_csv(here("walmart/train.csv.zip"))
##
## -- Column specification --------------------------------------------------------
## cols(
## Store = col_double(),
## Dept = col_double(),
## Date = col_date(format = ""),
## Weekly_Sales = col_double(),
## IsHoliday = col_logical()
## )
test <- read_csv(here("walmart/test.csv.zip"))
##
## -- Column specification --------------------------------------------------------
## cols(
## Store = col_double(),
## Dept = col_double(),
## Date = col_date(format = ""),
## IsHoliday = col_logical()
## )
train %<>% janitor::clean_names()
test %<>% janitor::clean_names()
train %>%
select(date, weekly_sales) %>%
ggplot(aes(x = date, y = weekly_sales)) +
geom_line() -> p
ggplotly(p)